{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###### Content under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2018 D. Koehn, notebook style sheet by L.A. Barba, N.C. Clementi"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<link href=\"https://fonts.googleapis.com/css?family=Merriweather:300,300i,400,400i,700,700i,900,900i\" rel='stylesheet' >\n",
       "<link href=\"https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,400,400i,700,700i\" rel='stylesheet' >\n",
       "<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:300,400' rel='stylesheet' >\n",
       "<style>\n",
       "\n",
       "@font-face {\n",
       "    font-family: \"Computer Modern\";\n",
       "    src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');\n",
       "}\n",
       "\n",
       "\n",
       "#notebook_panel { /* main background */\n",
       "    background: rgb(245,245,245);\n",
       "}\n",
       "\n",
       "div.cell { /* set cell width */\n",
       "    width: 800px;\n",
       "}\n",
       "\n",
       "div #notebook { /* centre the content */\n",
       "    background: #fff; /* white background for content */\n",
       "    width: 1000px;\n",
       "    margin: auto;\n",
       "    padding-left: 0em;\n",
       "}\n",
       "\n",
       "#notebook li { /* More space between bullet points */\n",
       "margin-top:0.5em;\n",
       "}\n",
       "\n",
       "/* draw border around running cells */\n",
       "div.cell.border-box-sizing.code_cell.running { \n",
       "    border: 1px solid #111;\n",
       "}\n",
       "\n",
       "/* Put a solid color box around each cell and its output, visually linking them*/\n",
       "div.cell.code_cell {\n",
       "    background-color: rgb(256,256,256); \n",
       "    border-radius: 0px; \n",
       "    padding: 0.5em;\n",
       "    margin-left:1em;\n",
       "    margin-top: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "div.text_cell_render{\n",
       "    font-family: 'Source Sans Pro', sans-serif;\n",
       "    line-height: 140%;\n",
       "    font-size: 110%;\n",
       "    width:680px;\n",
       "    margin-left:auto;\n",
       "    margin-right:auto;\n",
       "}\n",
       "\n",
       "/* Formatting for header cells */\n",
       ".text_cell_render h1 {\n",
       "    font-family: 'Merriweather', serif;\n",
       "    font-style:regular;\n",
       "    font-weight: bold;    \n",
       "    font-size: 250%;\n",
       "    line-height: 100%;\n",
       "    color: #004065;\n",
       "    margin-bottom: 1em;\n",
       "    margin-top: 0.5em;\n",
       "    display: block;\n",
       "}\t\n",
       ".text_cell_render h2 {\n",
       "    font-family: 'Merriweather', serif;\n",
       "    font-weight: bold; \n",
       "    font-size: 180%;\n",
       "    line-height: 100%;\n",
       "    color: #0096d6;\n",
       "    margin-bottom: 0.5em;\n",
       "    margin-top: 0.5em;\n",
       "    display: block;\n",
       "}\t\n",
       "\n",
       ".text_cell_render h3 {\n",
       "    font-family: 'Merriweather', serif;\n",
       "\tfont-size: 150%;\n",
       "    margin-top:12px;\n",
       "    margin-bottom: 3px;\n",
       "    font-style: regular;\n",
       "    color: #008367;\n",
       "}\n",
       "\n",
       ".text_cell_render h4 {    /*Use this for captions*/\n",
       "    font-family: 'Merriweather', serif;\n",
       "    font-weight: 300; \n",
       "    font-size: 100%;\n",
       "    line-height: 120%;\n",
       "    text-align: left;\n",
       "    width:500px;\n",
       "    margin-top: 1em;\n",
       "    margin-bottom: 2em;\n",
       "    margin-left: 80pt;\n",
       "    font-style: regular;\n",
       "}\n",
       "\n",
       ".text_cell_render h5 {  /*Use this for small titles*/\n",
       "    font-family: 'Source Sans Pro', sans-serif;\n",
       "    font-weight: regular;\n",
       "    font-size: 130%;\n",
       "    color: #e31937;\n",
       "    font-style: italic;\n",
       "    margin-bottom: .5em;\n",
       "    margin-top: 1em;\n",
       "    display: block;\n",
       "}\n",
       "\n",
       ".text_cell_render h6 { /*use this for copyright note*/\n",
       "    font-family: 'Source Code Pro', sans-serif;\n",
       "    font-weight: 300;\n",
       "    font-size: 9pt;\n",
       "    line-height: 100%;\n",
       "    color: grey;\n",
       "    margin-bottom: 1px;\n",
       "    margin-top: 1px;\n",
       "}\n",
       "\n",
       "    .CodeMirror{\n",
       "            font-family: \"Source Code Pro\";\n",
       "\t\t\tfont-size: 90%;\n",
       "    }\n",
       "/*    .prompt{\n",
       "        display: None;\n",
       "    }*/\n",
       "\t\n",
       "    \n",
       "    .warning{\n",
       "        color: rgb( 240, 20, 20 )\n",
       "        }  \n",
       "</style>\n",
       "<script>\n",
       "    MathJax.Hub.Config({\n",
       "                        TeX: {\n",
       "                           extensions: [\"AMSmath.js\"], \n",
       "                           equationNumbers: { autoNumber: \"AMS\", useLabelIds: true}\n",
       "                           },\n",
       "                tex2jax: {\n",
       "                    inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
       "                    displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
       "                },\n",
       "                displayAlign: 'center', // Change this to 'center' to center equations.\n",
       "                \"HTML-CSS\": {\n",
       "                    styles: {'.MathJax_Display': {\"margin\": 4}}\n",
       "                }\n",
       "        });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Execute this cell to load the notebook's style sheet, then ignore it\n",
    "from IPython.core.display import HTML\n",
    "css_file = '../style/custom.css'\n",
    "HTML(open(css_file, \"r\").read())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Isotropic acoustic media\n",
    "\n",
    "Starting from the 3D isotropic linear-elastic case, we derive the wave equation for a 3D acoustic medium "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3D acoustic wave equation\n",
    "\n",
    "Starting from the 3D equations of motion for an isotropic linear-elastic medium\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} + \\frac{\\partial \\sigma_{12}}{\\partial x_2} + \\frac{\\partial \\sigma_{13}}{\\partial x_3} \\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{21}}{\\partial x_1} + \\frac{\\partial \\sigma_{22}}{\\partial x_2} + \\frac{\\partial \\sigma_{23}}{\\partial x_3} \\nonumber \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &= \\frac{\\partial \\sigma_{31}}{\\partial x_1} + \\frac{\\partial \\sigma_{32}}{\\partial x_2} + \\frac{\\partial \\sigma_{33}}{\\partial x_3} \\nonumber \\\\\n",
    "\\sigma_{11} &= \\lambda(\\epsilon_{11}+\\epsilon_{22}+\\epsilon_{33}) + 2 \\mu \\epsilon_{11}\\nonumber \\\\\n",
    "\\sigma_{22} &= \\lambda(\\epsilon_{11}+\\epsilon_{22}+\\epsilon_{33}) + 2 \\mu \\epsilon_{22}\\nonumber \\\\\n",
    "\\sigma_{33} &= \\lambda(\\epsilon_{11}+\\epsilon_{22}+\\epsilon_{33}) + 2 \\mu \\epsilon_{33}\\nonumber \\\\\n",
    "\\sigma_{12} &= 2 \\mu \\epsilon_{12}\\nonumber \\\\\n",
    "\\sigma_{13} &= 2 \\mu \\epsilon_{13}\\nonumber \\\\\n",
    "\\sigma_{23} &= 2 \\mu \\epsilon_{23}\\nonumber \\\\\n",
    "\\end{align}\n",
    "\n",
    "we can easily derive the equations for the acoustic approximation by setting the shear modulus $\\mu=0$, so we get:\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2 u_1}{\\partial t^2} &= \\frac{\\partial \\sigma_{11}}{\\partial x_1} \\\\\n",
    "\\rho\\frac{\\partial^2 u_2}{\\partial t^2} &= \\frac{\\partial \\sigma_{22}}{\\partial x_2} \\\\\n",
    "\\rho\\frac{\\partial^2 u_3}{\\partial t^2} &=  \\frac{\\partial \\sigma_{33}}{\\partial x_3} \\\\\n",
    "\\sigma_{11} &= \\sigma_{22} = \\sigma_{33}  = \\lambda(\\epsilon_{11}+\\epsilon_{22}+\\epsilon_{33}) \\\\\n",
    "\\end{align}\n",
    "\n",
    "From eq. (4), we can define the **pressure P** as:\n",
    "\n",
    "\\begin{equation}\n",
    "P := (\\sigma_{11}+\\sigma_{22}+\\sigma_{33})/3 = \\lambda(\\epsilon_{11}+\\epsilon_{22}+\\epsilon_{33}) \\nonumber\n",
    "\\end{equation}\n",
    "\n",
    "By applying the partial derivative $\\partial/\\partial x_1$ to eq. (1), $\\partial/\\partial x_2$ to eq. (2) and $\\partial/\\partial x_3$ to eq. (3) and assuming that the **density in the subsurface is constant**, we get\n",
    "\n",
    "\\begin{align}\n",
    "\\rho\\frac{\\partial^2}{\\partial t^2} \\frac{\\partial u_1}{\\partial x_1} &= \\frac{\\partial^2 \\sigma_{11}}{\\partial x_1^2} \\\\\n",
    "\\rho\\frac{\\partial^2}{\\partial t^2} \\frac{\\partial u_2}{\\partial x_2} &= \\frac{\\partial^2 \\sigma_{22}}{\\partial x_2^2} \\\\\n",
    "\\rho\\frac{\\partial^2}{\\partial t^2} \\frac{\\partial u_3}{\\partial x_3} &= \\frac{\\partial^2 \\sigma_{33}}{\\partial x_3^2}\n",
    "\\end{align}\n",
    "\n",
    "Summing eqs. (5) - (7) leads to\n",
    "\n",
    "\\begin{equation}\n",
    "\\rho \\frac{\\partial^2}{\\partial t^2} \\biggl\\{\\frac{\\partial u_1}{\\partial x_1} + \\frac{\\partial u_2}{\\partial x_2} + \\frac{\\partial u_3}{\\partial x_3}\\biggr\\}= \\frac{\\partial^2 \\sigma_{11}}{\\partial x_1^2} + \\frac{\\partial^2 \\sigma_{22}}{\\partial x_2^2} + \\frac{\\partial^2 \\sigma_{33}}{\\partial x_3^2}\n",
    "\\end{equation}\n",
    "\n",
    "or, using eq. (4) and the definition of the pressure:\n",
    "\n",
    "\\begin{equation}\n",
    "\\frac{\\rho}{\\lambda} \\frac{\\partial^2 P}{\\partial t^2} = \\frac{\\partial^2 P}{\\partial x_1^2} + \\frac{\\partial^2 P}{\\partial x_2^2} + \\frac{\\partial^2 P}{\\partial x_3^2}\\nonumber\n",
    "\\end{equation}\n",
    "\n",
    "With the definition of the P-wave velocity $V_p$ in an acoustic medium \n",
    "\n",
    "\\begin{equation}\n",
    "V_p = \\sqrt{\\frac{\\lambda}{\\rho}}\\nonumber\n",
    "\\end{equation}\n",
    "\n",
    "we finally get the **3D acoustic wave equation**\n",
    "\n",
    "\\begin{equation}\n",
    "\\frac{1}{V_p^2} \\frac{\\partial^2 P}{\\partial t^2} = \\frac{\\partial^2 P}{\\partial x_1^2} + \\frac{\\partial^2 P}{\\partial x_2^2} + \\frac{\\partial^2 P}{\\partial x_3^2}\\nonumber\n",
    "\\end{equation}\n",
    "\n",
    "### Examples of acoustic media\n",
    "\n",
    "* Everything related to liquids, e.g. a water droplet, cup of tea, puddle, the human body (except for the bones, which are anisotropic elastic materials), lake, ocean ...\n",
    "* Also gaseous media, like the earth atmosphere, giant gas planets like Jupiter or stars like the sun ...\n",
    "* Unfortunately, the solid earth is **not** an acoustic medium. Nevertheless, the acoustic approximation can be applied to some extent."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## We learned:\n",
    "\n",
    "* How to derive the 3D isotropic acoustic wave equation\n",
    "* Some examples of acoustic media"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  },
  "widgets": {
   "state": {},
   "version": "1.1.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
